<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>vue使用之父子组件传值</title>
    <script src="../vue.min.js" type="text/javascript"></script>
</head>
<body>
<div id="app">
    <boy-component :msg="msg"></boy-component>
</div>

<script type="text/javascript">
    var boyComponent = {
        props:['msg'],
        template: `<div>{{msg}}</div>`
    }

    var app=new Vue({
        el: '#app',
        data:{
            msg:'hello，子组件'
        },
        components: {
            boyComponent
        }
    })
</script>
</body>
</html>